import { ref } from 'vue'
import useNotification from './useNotification'

const darkModeActive = ref(false)
const useDarkMode = () => {
  const { setNotification } = useNotification()

  const toggleDarkMode = () => {
    darkModeActive.value = !darkModeActive.value
    const type = darkModeActive.value ? 'dark mode' : 'light mode'
    console.log(darkModeActive)
    return setNotification(`${type} turned on!`)
  }

  return {
    darkMode: darkModeActive,
    toggleDarkMode,
  }
}

export default useDarkMode
